package uba.algo3.tp3.tsp;

public class Intercambio
{
	private int n1;
	private int n2;
	private int tiempoExpiracion;
	
	public int getN1()
	{
		return n1;
	}
	
	public void setN1(int n1)
	{
		this.n1 = n1;
	}
	
	public int getN2()
	{
		return n2;
	}
	
	public void setN2(int n2)
	{
		this.n2 = n2;
	}

	public Intercambio(int n1, int n2, int tiempoExpiracion)
	{
		super();
		this.n1 = n1;
		this.n2 = n2;
		this.tiempoExpiracion = tiempoExpiracion + 1;
	}
	
	public int hashCode()
	{
		final int prime = 31;
		int result = 1;
		result = prime * result + n1;
		result = prime * result + n2;
		return result;
	}

	public boolean equals(Object obj)
	{
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Intercambio other = (Intercambio) obj;
		if (n1 != other.n1)
			return false;
		if (n2 != other.n2)
			return false;
		return true;
	}

	public void restarTiempo()
	{
		tiempoExpiracion--;
	}
	
	public int getTiempoExpiracion()
	{
		return tiempoExpiracion;
	}
	
}
